package com.bite.springioc.Controller;

import com.bite.springioc.Component.UserComponent;
import com.bite.springioc.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

@Controller
public class UserComtroller {
//属性注入
//    @Autowired
    private UserService userService;
    private UserComponent userComponent;
    //构造方法注入


//    public UserComtroller(UserService userService){
//        this.userService = userService;
//    }
//    @Autowired
//    public UserComtroller(UserComponent userComponent, UserService userService){
//        this.userService = userService;
//        this.userComponent = userComponent;
//    }
@Autowired
    public void setUserService(UserService userService){
        this.userService = userService;
    }



    public void doHi(){
        userService.doService();
//        userComponent.doComponent();
        System.out.println("hello UserComtroller----");
    }
}
